package org.lmind.example.common.web.spring;

import javax.servlet.http.HttpServletRequest;

import org.lmind.example.common.api.auth.Certificate;
import org.lmind.example.common.core.HashMapAttributes;
import org.lmind.example.common.core.WritableAttributes;
import org.lmind.example.common.web.SessionContext;

class GeneralSessionContext implements SessionContext {
	
	private HttpServletRequest request;
	
	private Certificate certificate;
	
	private Object model;
	
	private HashMapAttributes attributes = new HashMapAttributes();

	public HttpServletRequest getRequest() {
		return request;
	}

	public void setRequest(HttpServletRequest request) {
		this.request = request;
	}

	@Override
	public Certificate getCertificate() {
		return certificate;
	}

	@Override
	public void setCertificate(Certificate certificate) {
		this.certificate = certificate;
	}
	
	@Override
	public String getContextPath() {
		return request.getContextPath();
	}
	
	@Override
	public String getRequestURI() {
		return request.getRequestURI();
	}
	
	@Override
	public Object getModel() {
		return model;
	}

	public void setModel(Object model) {
		this.model = model;
	}
	
	public void setAttributes(HashMapAttributes attributes) {
		this.attributes = attributes;
	}

	@Override
	public WritableAttributes getAttributes() {
		return attributes;
	}



}
